/*
 * Event
 * 
 * v1.0
 *
 * 11/24/2014
 * 
 * Copyright Richard R. Cachero Jr.
 */
package patchy;

import java.io.Serializable;
import java.util.Date;

public class Event implements Serializable, Comparable{
    private String title;
    private String from;
    private String to;
    private Date date;
    private String alarm;
    private String desc;
    private Course course;
    private int score = 0;
    private int scoreMax = 0;
    
    public Event(String title, Course course, String from, String to,
            Date date,  String alarm, String desc) {
        this.title = title;
        this.course = course;
        this.from = from;
        this.to = to;
        this.date = date;
        this.alarm = alarm;
        this.desc = desc;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @return the from
     */
    public String getFrom() {
        return from;
    }

    /**
     * @param from the from to set
     */
    public void setFrom(String from) {
        this.from = from;
    }

    /**
     * @return the to
     */
    public String getTo() {
        return to;
    }

    /**
     * @param to the to to set
     */
    public void setTo(String to) {
        this.to = to;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @param date the date to set
     */
    public void setDate(Date date) {
        this.date = date;
    }

    /**
     * @return the alarm
     */
    public String getAlarm() {
        return alarm;
    }

    /**
     * @param alarm the alarm to set
     */
    public void setAlarm(String alarm) {
        this.alarm = alarm;
    }
    
    /**
     * @return the desc
     */
    public String getDesc() {
        return desc;
    }

    /**
     * @param desc the repeat to set
     */
    public void setDesc(String desc) {
        this.desc = desc;
    }

    /**
     * @return the course
     */
    public Course getCourse() {
        return course;
    }

    /**
     * @param course the course to set
     */
    public void setCourse(Course course) {
        this.course = course;
    }

    /**
     * @return the score
     */
    public int getScore() {
        return score;
    }

    /**
     * @param score the score to set
     */
    public void setScore(int score) {
        this.score = score;
    }

    /**
     * @return the scoreMax
     */
    public int getScoreMax() {
        return scoreMax;
    }

    /**
     * @param scoreMax the scoreMax to set
     */
    public void setScoreMax(int scoreMax) {
        this.scoreMax = scoreMax;
    }
    
    /**
     * Repetition of event
     */
    public void recur() {
        
    }
    
    @Override
    public String toString() {
        return title + " " + date.toString().substring(4, 10);
    }

    @Override
    public int compareTo(Object o) {
        return date.compareTo(((Event) o).getDate());
    }
}
